<template>
  <Form
    :label-width="110"
    ref="formValidate"
    :rules="ruleValidate"
    :model="formValidate"
    label-position="left"
  >
    <FormItem label="参数名称" prop="parameterName">
      <i-input
        type="text"
        v-model="formValidate.parameterName"
        placeholder="参数名称"
      >
      </i-input>
    </FormItem>
    <FormItem label="参数类型编号" prop="parameterGroup">
      <i-input
        type="text"
        v-model="formValidate.parameterGroup"
        placeholder="参数类型编号"
      >
      </i-input>
    </FormItem>
    <FormItem label="参数编号" prop="parameterCode">
      <i-input
        type="text"
        v-model="formValidate.parameterCode"
        placeholder="参数编号"
      >
      </i-input>
    </FormItem>
    <FormItem label="参数值">
      <i-input
        type="text"
        v-model="formValidate.parameterValue"
        placeholder="参数值"
      >
      </i-input>
    </FormItem> <FormItem label="生效环境" prop="">
    <i-input
      type="text"
      v-model="formValidate.effectiveEnvironment"
      placeholder="test/pro/dev"
    >
    </i-input>
  </FormItem>
    <FormItem label="备注" prop="">
      <i-input
        type="textarea"
        v-model="formValidate.memo"
        placeholder="备注"
      >
      </i-input>
    </FormItem>
    <FormItem>
      <Button
        type="primary"
        @click="publicSubmit('formValidate')"
      >确定
      </Button>
      <Button @click="publicReset('formValidate')" style="margin-left: 8px">取消</Button>
    </FormItem>
  </Form>
</template>

<script>
import { updateMixin } from '../../../mixin'
import API_KEY from '../../../api'

export default {
  name: 'ParameterManageUpdate',
  mixins: [updateMixin],
  data () {
    return {
      formValidate: {
        effectiveEnvironment: '',
        parameterGroup: '',
        parameterCode: '',
        parameterName: '',
        parameterValue: '',
        memo: ''
      },
      // 表单校验规则
      ruleValidate: {
        parameterGroup: [{ required: true, message: '当前项不能为空', trigger: 'blur' }],
        parameterCode: [{ required: true, message: '当前项不能为空', trigger: 'blur' }],
        parameterName: [{ required: true, message: '当前项不能为空', trigger: 'blur' }]
      },
      // 请求地址
      action: {
        readDataById: API_KEY.parameter.curdParameter,
        // 新增数据
        createData: API_KEY.parameter.curdParameter,
        // 更新数据
        updateData: API_KEY.parameter.curdParameter
      }
    }
  }
}
</script>

<style scoped>

</style>
